package com.freecloud.javabasics.design.delegate.leader;

import java.util.HashMap;
import java.util.Map;

/**
 * 委派者
 * @Author: maomao
 * @Date: 2019-11-18 10:06
 */
public class Leader implements Action {

    private Map<String,Action> allAction = new HashMap<>();

    public Leader(){
        allAction.put("开发",new Staff1());
        allAction.put("测试",new Staff2());
    }



    @Override
    public void doing(String action) {

        allAction.get(action).doing(action);
    }
}
